package emulator.unittest.hardware.nmos6502.commands;

import static org.junit.Assert.*;

import org.junit.Test;

import emulator.EmulatorException;
import emulator.hardware.HwByte;
import emulator.hardware.nmos6502.Cpu6502;
import emulator.hardware.nmos6502.commands.TSX;
import emulator.hardware.nmos6502.operands.NoOperand;

public class TSXTest {

	@Test
	public void testExecute() throws EmulatorException {
		Cpu6502 cpu = new Cpu6502();
		HwByte sp = new HwByte(0x55);
		cpu.setSP(sp);
		cpu.setX(new HwByte(0));
		TSX tsx = new TSX();
		tsx.execute(cpu, new NoOperand());
		assertEquals(sp, cpu.getSP());
		assertEquals(sp, cpu.getX());
	}

}
